package com.ssyt.yt1.day10.adapter;

import java.awt.event.WindowEvent;

interface MyWindowListener {

	public void windowOpened(WindowEvent e);

	public void windowClosing(WindowEvent e);

	public void windowClosed(WindowEvent e);

	public void windowIconified(WindowEvent e);

	public void windowDeiconified(WindowEvent e);

	public void windowActivated(WindowEvent e);

	public void windowDeactivated(WindowEvent e);

	public void windowOpened1(WindowEvent e);

	public void windowClosing2(WindowEvent e);

	public void windowClosed3(WindowEvent e);

	public void windowIconified4(WindowEvent e);

	public void windowDeiconified5(WindowEvent e);

	public void windowActivated6(WindowEvent e);

	public void windowDeactivated7(WindowEvent e);
}

/**
 * 适配器模式一：中间层适配！
 * 
 * @author Administrator
 *
 */
abstract class MyWindowAdapter implements MyWindowListener {

	@Override
	public void windowOpened(WindowEvent e) {
	}

	@Override
	public void windowClosing(WindowEvent e) {
	}

	@Override
	public void windowClosed(WindowEvent e) {
	}

	@Override
	public void windowIconified(WindowEvent e) {
	}

	@Override
	public void windowDeiconified(WindowEvent e) {
	}

	@Override
	public void windowActivated(WindowEvent e) {
	}

	@Override
	public void windowDeactivated(WindowEvent e) {
	}

	@Override
	public void windowOpened1(WindowEvent e) {
	}

	@Override
	public void windowClosing2(WindowEvent e) {
	}

	@Override
	public void windowClosed3(WindowEvent e) {
	}

	@Override
	public void windowIconified4(WindowEvent e) {
	}

	@Override
	public void windowDeiconified5(WindowEvent e) {
	}

	@Override
	public void windowActivated6(WindowEvent e) {
	}

	@Override
	public void windowDeactivated7(WindowEvent e) {
	}

}

public class AdapterDemo1 extends MyWindowAdapter {

	@Override
	public void windowClosing(WindowEvent e) {
		System.out.println("游戏窗口关闭！");
	}

	public static void main(String[] args) {
		new AdapterDemo1().windowClosing(null);
	}
}
